using TickSharp.Core.Infrastructure;
using TickSharp.Core.Interfaces;
using Xunit;

namespace TickSharp.Tests.UnitTests
{
    public class ApiConnectionInfoTester
    {
        [Fact]
        public void AuthenticationQueryStringDoesNotEscapeInvalidUrlCharacters()
        {
            const string userName = "username";
            const string passwordWithInvalidUrlCharacters = "pass+wor#d";
            const string projectDomain = "domain";

            string expected = string.Format("email={0}&password={1}", userName, passwordWithInvalidUrlCharacters);

            IApiConnectionInfo client = new ApiConnectionInfo(projectDomain, userName, passwordWithInvalidUrlCharacters);

            string authenticationQueryString = client.AuthenticationQueryString();

            Assert.Equal(expected, authenticationQueryString);
        }
    }
}